<template>
  <div class="app-container">
    <div class="table_content">
      <div class="btn-btm">
        <el-button type="warning" size="mini"
                   @click="refusedAdd">提交审核</el-button>
        <el-button type="primary" plain size="mini" @click="handleAdd">添加</el-button>
      </div>
      <el-table ref="table" v-loading="loading" :data="list" style="width: 100%;" border
                :header-cell-style="{background: '#F8F8F9',padding: '6px 0 !important',color: '#515a6e'}"
                @selection-change="handleSelectionChange">
        <el-table-column type="selection" fixed="left" width="55"/>
        <af-table-column prop="director" label="施工项目负责人" />
        <af-table-column prop=constructRemark" label="施工备注说明" />
        <af-table-column prop="qualityDesc" label="质量控制说明" />
        <el-table-column fixed="right" label="操作" min-width="100">
          <template slot-scope="scope">
            <el-button class="btn" type="text" size="small"
            @click="handleEdit(scope.$index,scope.row)">编辑</el-button>
            <el-popover
              placement="top"
              width="200"
              trigger="manual"
              :ref="'popover-' + scope.row.id">
              <p>确定删除该数据吗？</p>
              <div style="text-align: right; margin: 0">
                <el-button size="mini" type="text" @click="$refs[`popover-` + scope.row.id].doClose()">取消</el-button>
                <el-button type="primary" size="mini" @click="handleDel(scope.$index,scope.row)">确定</el-button>
              </div>
              <el-button class="btn" type="text" size="small" slot="reference"
                         @click="$refs[`popover-` + scope.row.id].doShow()">删除</el-button>
            </el-popover>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
  import { doPost, doGet, doFile, orglistChild } from '@/api/index'
  import Pagination from '@/components/Pagination/index'

  export default {
    name: "quality",
    components: {Pagination},
    data() {
      return{
        loading: false,
        list: []
      }
    },
    created(){},
    methods: {
      handleAdd() {},
      handleEdit(index, row){},
      handleDel(index, row){},
      handleSelectionChange(val) {},
      refusedAdd() {}
    }
  }
</script>

<style scoped>

</style>
